package www.wcx;

import java.util.Map;

import kafka.producer.Partitioner;

/**
 * 项目: kafka
 * <p>
 * 功能描述: 自定义分区
 *
 * @author: WuChengXing
 * @create: 2020-12-29 20:12
 **/
public class CustomPartitioner implements Partitioner {
    public CustomPartitioner() {
        super();
    }

    @Override
    public int partition(Object key, int numPartitions) {
        // 控制分区
        return 0;
    }

}
